# -*- coding: utf-8 -*-
'''
Created on 2020/1/2 13:43 
author:dyx
IDE:PyCharm 
'''
from keras.layers import LSTM, Dense, Activation
from keras.models import Sequential
#定义模型
#定义一个具有两个存储单元的LSTM隐藏层
# model = Sequential()
# model.add(LSTM(2))
# model.add(Dense(1))

# layers = [LSTM(2),Dense(1)]
# model = Sequential(layers)
X = 0
y = 0

model = Sequential()
model.add(LSTM(5,input_shape=(2,1)))
model.add(Dense(1))
model.add(Activation('sigmoid'))
#编译模型
model.compile(optimizer = 'sgd',loss='mse')
model.compile(optimizer= 'sgd', loss= 'mean_squared_error', metrics=[ 'accuracy'])
#拟合模型
model.fit(X, y, batch_size=32, epochs=100)
#评价模型
ss, accuracy = model.evaluate(X, y)
#预测模型
predictions = model.predict(X)

